import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// css 重置，源码：https://github.com/necolas/normalize.css/blob/master/normalize.css
import 'normalize.css'
// 自定义的 flex 样式
import './assets/css/c-flex.css'
// 自定义的全局样式
import './assets/css/global.css'

// 路由访问权限
import './permission.js'

const app = createApp(App)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(createPinia())
app.use(router)
app.use(ElementPlus)

app.mount('#app')